from typing import Optional, List

from pydantic import BaseModel, Field


class Parameter(BaseModel):
    a: int = Field(description="first param")
    b: int
    c: float
    desc: Optional[str] = "no description"
    test_list: Optional[list[int]] = None
    test_dict: Optional[dict[int, dict[str, str]]] = None #default list
    test_typing_list: Optional[List[int]] = None  #typing list


class Result(BaseModel):
    y: float
    optional_str: Optional[str] = None

def add(param: Parameter) -> Result:
    y = param.a + param.b + param.c
    return Result(y=y)
